<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/9/20
 * Time: 9:06
 */
$num1=$_GET["num1"];
$num2=$_GET["num2"];
$op = $_GET["op"];
$result =$num1.$op.$num2;

?>

<html>
<body>
<form action="cal.php" method="get">
<input type="text" name="num1" value="<?php echo $num1?>" />
<select name="op">
    <option value="+" <?php echo $op=='+'? 'selected':''?>>+</option>
    <option value="-" <?php echo $op=='-'? 'selected':''?>>-</option>
    <option value="*" <?php echo $op=='*'? 'selected':''?>>*</option>
    <option value="%" <?php echo $op=='%'? 'selected':''?>>%</option>
</select>
<input type="text" name="num2" value="<?php echo $num2?>"/>
=
<input type="text" name="result" value="<?php echo $result?>"/>

<BUTTON type="submit" >计算</BUTTON>
</form>
</body>

</html>
